# Contributor: rubicon <rubicon@mailo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
maintainer="Celeste <cielesti@protonmail.com>"
pkgname=irssi-tcl
pkgver=0_git20210919
_gitrev=9cd796620be88f0a1320d24532e35015a6dd94b5
pkgrel=1
pkgdesc="Tcl scripting module for the irssi IRC client"
url="https://github.com/horgh/irssi-tcl"
arch="all"
license="GPL-3.0-or-later"
depends="irssi"
makedepends="glib-dev irssi-dev tcl-dev"
subpackages="$pkgname-doc"
options="!check"
source="$pkgname-$pkgver.tar.gz::https://github.com/horgh/irssi-tcl/archive/$_gitrev/irssi-tcl-$_gitrev.tar.gz
	systemscript.patch
	"
builddir="$srcdir/$pkgname-$_gitrev"

build() {
	make TCL_DIR=/usr/include -C src
}

package() {
	install -Dvm755 src/libtcl.so \
		-t "$pkgdir"/usr/lib/irssi/modules/

	install -Dvm644 README.md COPYING docs/*script*.md \
		-t "$pkgdir"/usr/share/doc/$pkgname/

	# Keep in sync with IRSSI_TCL_SYSTEM_PATH from systemscript.patch
	install -Dvm644 tcl/* \
		-t "$pkgdir"/usr/share/irssi/tcl/
}

sha512sums="
5f659250a97310c49d4996f3067e92970e30b9689997277c01ad6869d42c1c90e3c5355ea2d83ad605c45583790a0073f1fb230d7bdf768ecfd319f1aff847e3  irssi-tcl-0_git20210919.tar.gz
fe515d02f4c7ac40521221b465216fd1f3acc71b52050027aec550efdafa4ba45386f60686ac2d0ae53de9d3eebd6107b75148ff856d2a5588dd302c7ea3e8f6  systemscript.patch
"
